package com.zx.common.tools.id.components;

import com.zx.common.tools.id.IdGenerator;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * ID生成器组件
 * 提供统一的ID生成接口
 */
@Component
@RequiredArgsConstructor
public class IdGeneratorComponent {

    private final IdGenerator idGenerator;

    /**
     * 生成ID
     *
     * @return 生成的ID字符串
     */
    public String generateId() {
        return idGenerator.generateId();
    }

    /**
     * 生成带前缀的ID
     *
     * @param prefix 前缀
     * @return 带前缀的ID字符串
     */
    public String generateIdWithPrefix(String prefix) {
        return idGenerator.generateIdWithPrefix(prefix);
    }
}